<template>
  <div class="testb">
    <h2>{{ aaa }}</h2>
  </div>
</template>

<script>
import bus from '@/utils/bus'
export default {
  data() {
    return {
      aaa: ''
    }
  },
  beforeDestroy() {
    bus.$off('tb')
  },
  mounted() {
    bus.$on('tb', (num) => {
      this.aaa = num
    })
  }
}
</script>

<style>
.testb {
  height: 200px;
  width: 200px;
  background-color: green;
}
</style>
